package cn.org.rookie.jeesdp.service;

import cn.org.rookie.jeesdp.core.BaseEntity;
import cn.org.rookie.jeesdp.core.Page;
import cn.org.rookie.jeesdp.mapper.BaseMapper;
import cn.org.rookie.jeesdp.mapper.sql.Wrapper;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface BaseService<E extends BaseEntity, P, M extends BaseMapper<E, P>> {

    String insert(E param);

    List<String> insert(List<E> list);

    int delete(P param);

    int delete(List<P> params);

    int deleteBy(Wrapper wrapper);

    int update(E param);

    int updateBy(E param, Wrapper wrapper);

    String save(E entity);

    E find(P param);

    List<E> findBy(Wrapper wrapper);

    List<E> findAll();

    PageInfo<E> page(Page<E> page);
}
